import 'package:flutter/material.dart';
 void main(){
  runApp(
    MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('你好')),
        body: const Column(
          children: [
            MyApp(),
            MyButton(),
            MyText()
        ],
        )
        ),
    )
  );
}
class MyApp extends StatelessWidget{
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {

    return Center(
          child: Container(
            margin: const EdgeInsets.fromLTRB(0, 40, 0, 0),
            alignment: Alignment.center, //配置Container容器内元素的方位
            width: 200,
            height: 200,
            // transform: Matrix4.translationValues(-40, 0, 0), //位移
            // transform: Matrix4.rotationZ(0.2), //旋转
            transform: Matrix4.skewY(0.2),
            decoration:  BoxDecoration(
              color: Colors.red, //背景颜色
              border: Border.all( //边框
                color: Colors.yellow
              ),
              borderRadius: BorderRadius.circular(10), //配置圆角
              boxShadow: const [ //配置阴影效果
                BoxShadow(
                  color: Colors.black,
                  blurRadius: 10
                ),

              ],
              //LinearGradient 背景线性渐变 RadialGradient径向渐变
              gradient:const LinearGradient(
                colors: [
                  Colors.red,Colors.yellow,
                ]
              )
            ),
            child:const Text('你好啊',style:TextStyle(
              color: Colors.black,
              fontSize: 20
            ))
          ),
        );
  }
}
class MyButton extends StatelessWidget{
  const MyButton({super.key});

  @override
  Widget build(BuildContext context) {
   return Container(
    alignment: Alignment.center,
    width: 200,
    height: 40,
    // margin: const EdgeInsets.all(10), //四周边距
    margin: const EdgeInsets.fromLTRB(0, 40, 0, 0),
    // padding: EdgeInsets.all(4), //内边距
    decoration:  BoxDecoration(
      color:Colors.blue,
      borderRadius: BorderRadius.circular(10)
    ),
    child: const Text('按钮',style: TextStyle(
      color: Colors.white,
      fontSize: 20
    )),

   );
  }
}
class MyText extends StatelessWidget{
  const MyText({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 200,
      height: 200,
      margin: const EdgeInsets.fromLTRB(0, 40, 0, 0),
      decoration: const BoxDecoration(
        color: Colors.yellow
      ),
      child:  const Text(
        '你好我是MT',
        textAlign: TextAlign.left,
        overflow: TextOverflow.ellipsis, //溢出显示几个点
        maxLines: 1,
        style:TextStyle(
          fontSize: 20,
          fontWeight: FontWeight.w900,
          color: Colors.red,
          fontStyle: FontStyle.italic, //字体倾斜
          letterSpacing: 6, //字间距
          decoration:  TextDecoration.underline,
          decorationColor: Colors.black,
          decorationStyle: TextDecorationStyle.dashed
        )

      ),
    
    );
  }
}